<?php
namespace thinkless;

use think\App;
use think\app\MultiApp;
use think\app\Url;
use thinkless\patch\Request;

class Thinkless extends App {

    public function __construct() {
        parent::__construct();
        $this->event->listen('HttpRun', function () {
            $this->middleware->add(MultiApp::class);
        });
        $this->middleware->add(\think\middleware\SessionInit::class);
        $this->bind([
            'think\route\Url' => Url::class,
            'think\Request'          => Request::class,
            'think\exception\Handle' => ExceptionHandle::class,
        ]);
        Serverless::boot($this);
    }
}
